import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:myflutterproject/utils/overScrollBehavior.dart';
import 'package:myflutterproject/routes.dart';

class FlutterChineseDemo extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => FlutterChineseState();
}

class FlutterChineseState extends State<FlutterChineseDemo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        title: Text("Flutter中文网学习历程"),
      ),
      body: Center(
        child: ScrollConfiguration(
          behavior: OverScrollBehavior(),
          child: ListView(
            children: <Widget>[
              ItemButton('基础Widget', basewidget),
              ItemButton('Material组件', basematerial),
              ItemButton('手势处理', basegesture),
              ItemButton('根据用户输入改变Widget', basecahngewidget),
              ItemButton('整合例子', baseconformity),
              ItemButton('Widgets目录', basecatalogwidgets),
            ],
          ),
        ),
      ),
    );
  }

}


class ItemButton extends StatelessWidget {
  final String title;
  final String router;

  ItemButton(this.title, this.router);

  @override
  Widget build(BuildContext context) =>
      FlatButton(
        onPressed: ()=>Navigator.pushNamed(context, router),
        child: Text(title,style: TextStyle(fontSize: 20.0,color: Colors.blue),),
        textColor: Colors.black,
      );


}
